FlexGrid for UWP/WinRT
DeferNotifications メソッド
使用例 

返される System.IDisposable オブジェクトが破棄されるまで、通知を一時停止します。
構文
'宣言
 
Public Function DeferNotifications() As System.IDisposable
public System.IDisposable DeferNotifications()

戻り値の型

これが破棄されるまで通知が再開されない System.IDisposable オブジェクト。
解説
このメソッドは一般に、バッチ更新を効率よく安全に実行するためにアップデートブロックで使用されます。
使用例

以下のサンプルは、グリッドで複数の列の幅を設定する間、DeferNotifications メソッドを使用して通知を一時停止する方法を示します。

DeferNotifications メソッドの呼び出しが using 文に置かれていることに注意してください。これにより、ブロック内のコードが例外を生成した場合でも、オブジェクトが自動的に破棄され、ブロックの終りで通知が再開されます。これは、try/finally ブロック内で BeginUpdate メソッドと EndUpdate メソッドを呼び出す従来の方法より、コードが読みやすく簡潔です。

var grid = new C1FlexGrid();
using (grid.Columns.DeferNotifications())
{
foreach (var col in grid.Columns)
{
col.Width = 100;
}
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

参照

関連項目

RowColCollection<T> クラス
RowColCollection<T> メンバ

Send Feedback